#include<iostream>
#include<string>
using namespace std;
string s;
int main()
{
	cin >> s;
	s = " " + s;
	int n = s.size() - 1;
	int i = 1, j = 2, k = 0;
	while (i <= n && j <= n) {
		for (k = 0; k <= n && s[i + k] == s[j + k]; k++);
		s[i + k] > s[j + k] ? i += k + 1 : j += k + 1;
		if (i == j) j++;
	}
	int ans = min(i, j);
	cout << ans << endl;
	return 0;
}